{sm_shop_template 'common/header'}
<div id="container">
    {sm_shop_template 'common/nav'}
    <div id="content" >
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <a href="{php echo $this->url_pre . '&r=huodong.page_edit';}"
                       data-toggle="tooltip" title="" class="btn btn-primary"
                       data-original-title="添加">
                        <i class="fa fa-plus"></i>
                    </a>
                    <a href="{php echo $this->url_pre . '&r=huodong.page_list';}"
                       data-toggle="tooltip" title=""
                       class="btn btn-default" data-original-title="重建">
                        <i class="fa fa-refresh"></i>
                    </a>
                </div>
                <h1>营销推广</h1>
                <ul class="breadcrumb">
                    <li><a href="">营销推广</a></li>
                    <li><a href="">活动</a></li>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row">
                <div id="filter-product" class="col-md-3 col-md-push-9 col-sm-12 hidden-sm hidden-xs">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><i class="fa fa-filter"></i> 筛选过滤</h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="control-label" for="input-name">活动名称</label>
                                <input type="text" name="filter_name"  v-model="filter.name" value="" placeholder="活动名称" id="input-name" class="form-control">
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="input-status">状态</label>
                                <select name="filter_status" v-model="filter.status" id="input-status" class="form-control">
                                    <option value=""></option>
                                    <option value="1">启用</option>
                                    <option value="0">禁用</option>
                                </select>
                            </div>
                            <div class="form-group text-right">
                                <button type="button" id="button-filter"
                                        v-on:click="search()"
                                        class="btn btn-default">
                                    <i class="fa fa-filter"></i> 筛选</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-9 col-md-pull-3 col-sm-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><i class="fa fa-list"></i> 活动列表</h3>
                        </div>
                        <div class="panel-body">
                            <form action="" method="post" enctype="multipart/form-data" id="form-category">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <td style="width: 1px;" class="text-center">
                                                <input type="checkbox" onclick="$('input[name*=\'selected\']').trigger('click');"></td>
                                            <td class="text-left">
                                                <a href="" class="asc">活动名称</a>
                                            </td>
                                            <td class="text-right">
                                                <a href="">排序</a>
                                            </td>
                                            <td class="text-right">状态</td>
                                            <td class="text-right">编辑活动</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="item,index in huodong_list"
                                            v-show="index>=(page.current-1)*page.item_num&&index<page.current*page.item_num"
                                        >
                                            <td class="text-center">
                                                <input type="checkbox"  v-model="selected_categoty" name="selected[]" v-bind:value="item.id">
                                            </td>
                                            <td class="text-left">{{item.cat_name}}</td>
                                            <td class="text-right">{{item.sort_order}}</td>
                                            <td class="text-right">
                                                <span v-show="item.status==1">启用</span>
                                                <span v-show="item.status==0">禁用</span>
                                            </td>
                                            <td class="text-right">
                                                <a v-bind:href="url_pre + '&r=category.page_edit&category_id=' + item.id "
                                                   data-toggle="tooltip" title="" class="btn btn-primary"
                                                   data-original-title="编辑">
                                                    <i class="fa fa-pencil"></i></a>
                                                <!--<a href="" target="_blank" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="查看">-->
                                                <!--<i class="fa fa-search"></i></a>-->
                                                <a  v-on:click="category_remove( item )"
                                                    class="btn btn-danger" data-original-title="删除">
                                                    <i class="fa fa-trash-o"></i>
                                                </a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </form>
                            <div class="row" v-show="page.total">

                                <div class="col-sm-6 text-left">
                                    <ul class="pagination" >
                                        <li v-for="item in page.total"
                                            v-show="item>=page.current-1 && item <= page.current+1"
                                            v-bind:class="{'active':item == page.current?1:0}"
                                            v-on:click="goto_page( item )"
                                        >
                                            <span>{{item }}</span>
                                        </li>
                                        <li v-on:click="goto_page(page.current+1)"><a>&gt;</a></li>
                                        <li v-on:click="goto_page(page.total)"><a>&gt;|</a></li>
                                    </ul></div>
                                <div class="col-sm-6 text-right">
                                    显示{{(page.current-1)*page.item_num+1}} - {{page.current*page.item_num}}
                                    / 合计 {{page.item_total}}（共 {{page.total}} 页）
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
{sm_shop_template 'common/footer'}

<script>

    var vue = new Vue( {
        el:'#container',

        data:function() {
            return {
                filter:{
                    name:''
                },

                page:{

                    total:0,
                    item_total:0,//总数量
                    item_num:10, //每页数量
                    current:1
                },

                url_pre:'{php echo $this->url_pre;}',
                huodong_list:[]

            }
        },

        methods:{

            search:function(){

            }
        },

        created:function(){

        }
    });
</script>